
<template>
    <div class="common-layout p-2 overflow-hidden" style="background: transparent;">
        <div id="PathMenu" data-tauri-drag-region class=" avatar cursor-pointer">
            <el-row>
                <el-col :span="8" data-tauri-drag-region>

                </el-col>
                <el-col :span="8" data-tauri-drag-region>

                    <div id="fd" data-tauri-drag-region class="aa w-24 rounded-full" v-show="!isOpen">

                        <div class="containers" @click="oc()">
                            <div class="circle-image">
                                <ZTtime style="z-index: 999;"></ZTtime>
                                <span></span>
                                <span></span>

                            </div>
                            <!-- <div class="ellipse rotate1 shadow-sm " style="transform: rotate(0deg) scaleX(1.15)"
                                v-show="!isOpen">
                            </div>
                            <div class="ellipse rotate2 shadow-sm " style="transform: rotate(60deg) scaleX(1.15)"
                                v-show="!isOpen">
                            </div>
                            <div class="ellipse rotate3 shadow-sm " style="transform: rotate(120deg) scaleX(1.15)"
                                v-show="!isOpen">
                            </div>
                            <div class="ellipse rotate4 shadow-sm" style="transform: rotate(150deg) scaleX(1.2)"
                                v-show="!isOpen">
                            </div>
                            <div class="ellipse rotate5 shadow-sm " style="transform: rotate(210deg) scaleX(1.2)"
                                v-show="!isOpen">
                            </div>
                            <div class="ellipse rotate6 shadow-sm " style="transform: rotate(270deg) scaleX(1.2)"
                                v-show="!isOpen">
                            </div>
                            <div class="ellipse rotate7 shadow-sm" style="transform: rotate(360deg) scaleX(1.15)"
                                v-show="!isOpen">
                            </div> -->


                        </div>

                    </div>
                    <div data-tauri-drag-region class="aa w-24 h-24 rounded-full" v-show="isOpen">

                        <div data-tauri-drag-region class="containers" @click="oc()">
                            <div class="circle-image2" style="width:100px;height: 100px;">
                                <span></span>
                                <span></span>
                            </div>
                        </div>
                    </div>
                </el-col>
                <el-col :span="8" data-tauri-drag-region v-show="isOpen" @click="weatherOpen">
                    <qweather />
                </el-col>
            </el-row>


        </div>
        <div class="bg-gradient-to-br from-gray-600 to-black  p-4 rounded-lg flex flex-col shadow-sm mt-5" v-show="isOpen"
            @click="dateOpen">
            <FlipClock></FlipClock>
        </div>
        <div class=" overflow-auto " v-show="isOpen" style="height: 65vh;">
            <el-row class="mt-2 mb-2">
                <el-col :span="4" v-for="(l, i) in appList" v-bind:key="i">

                    <div class="m-1 p-1 bg-gradient-to-br from-gray-600 to-black shadow-lg flex flex-col items-center justify-center h-12"
                        style="border-radius: 4px;" @click="appOpen(l)">
                        <el-tooltip class="box-item" effect="dark" :content="l.name" placement="left">
                            <div v-html="l.icon" class="text-center flex flex-col items-center justify-center"
                                style="margin: 0 auto;">
                            </div>
                        </el-tooltip>

                        <!-- <div class="text-black text-sm">{{ l.name }}</div> -->
                    </div>

                </el-col>

            </el-row>
            <el-row>
                <el-col :span="4" data-tauri-drag-region class="bg-gradient-to-b from-black to-gray-600"
                    style="border-radius: 8px;">
                    <div v-for="(s, i) in sysList" v-bind:key="i" @click="appOpen(s)">
                        <div v-html="s.icon" style="width: 32px;margin: 20px auto;">

                        </div>
                    </div>
                    <div @click="mapOpen()">
                        <div style="width: 32px;margin: 20px auto;">
                            <svg t="1705591966475" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                xmlns="http://www.w3.org/2000/svg" p-id="5835" width="32" height="32">
                                <path
                                    d="M208.979684 1023.998406h606.039873c115.461045 0 208.979266-93.518222 208.979267-208.979267V208.979266C1023.998824 93.518222 930.480602 0 815.019557 0H208.979684C93.51864 0 0.000418 93.518222 0.000418 208.979266v606.039873c0 115.461045 93.518222 208.979266 208.979266 208.979267z"
                                    fill="#E58DC9" p-id="5836"></path>
                                <path
                                    d="M438.856878 419.630367V1023.998406h376.162679c115.461045 0 208.979266-93.518222 208.979267-208.979267V648.149195L438.856878 419.630367z"
                                    fill="#F2C200" p-id="5837"></path>
                                <path
                                    d="M1023.998824 815.019139V208.979266C1023.998824 93.518222 930.480602 0 815.019557 0H208.979684C93.51864 0 0.000418 93.518222 0.000418 208.979266v16.718342l1023.998406 591.202345V815.019139z"
                                    fill="#5FE06D" p-id="5838"></path>
                                <path
                                    d="M271.673464 0v240.221667L30.093432 100.832496A207.913472 207.913472 0 0 0 0.000418 208.979266v212.845383l271.673046 156.83894V1023.998406h355.264753V783.776739l326.112146 188.185829A208.456818 208.456818 0 0 0 1023.998824 815.019139V674.585072L626.938217 445.334817V0H271.673464z"
                                    fill="#F5F5F7" p-id="5839"></path>
                                <path d="M303.020354 679.182616h292.570973V0H303.020354v679.182616z" fill="#1E86FB"
                                    p-id="5840"></path>
                                <path
                                    d="M449.305841 323.917863c-144.300183 0-261.224083 116.9239-261.224083 261.224083s116.9239 261.224083 261.224083 261.224083 261.224083-116.9239 261.224083-261.224083-116.9239-261.224083-261.224083-261.224083z"
                                    fill="#FCFCFF" p-id="5841"></path>
                                <path
                                    d="M449.305841 365.713716c-121.207975 0-219.42823 98.220255-219.42823 219.42823s98.220255 219.42823 219.42823 219.42823 219.42823-98.220255 219.42823-219.42823-98.220255-219.42823-219.42823-219.42823z"
                                    fill="#1E86FB" p-id="5842"></path>
                                <path
                                    d="M394.866742 717.321332L449.305841 657.657752l54.439099 59.66358c14.942018 16.300383 41.586874 1.358365 35.526475-19.85303l-69.903565-241.475543c-5.851419-20.06201-34.2726-20.06201-40.124019 0l-69.903564 241.475543c-6.060399 21.211396 20.584458 36.153413 35.526475 19.85303z"
                                    fill="#F6F6F6" p-id="5843"></path>
                                <path
                                    d="M1024.019721 225.802097c-97.906786-33.123214-171.154019-119.431651-185.573588-224.548221-7.627743-0.835917-15.464466-1.253876-23.405678-1.253876h-144.822632c16.195893 198.321324 162.690359 359.862297 353.801898 398.627951V225.802097z"
                                    fill="#C3C4CE" p-id="5844"></path>
                                <path
                                    d="M1024.019721 398.627951C832.908182 359.862297 686.413717 198.321324 670.217823 0h31.45138c15.882424 181.080534 148.584258 328.515407 322.350518 366.549633zM806.681284 0z m217.338437 258.716332c-115.670024-34.795048-202.709888-135.627544-217.338437-258.716332h8.359171c7.941212 0 15.777935 0.417959 23.405678 1.253876 14.419569 105.116571 87.666802 191.425008 185.573588 224.548221z"
                                    fill="#FFFFFF" p-id="5845"></path>
                            </svg>
                        </div>
                    </div>
                    <div @click="cosOpen()">
                        <div style="width: 32px;margin: 20px auto;">
                            <svg t="1704895363518" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                xmlns="http://www.w3.org/2000/svg" p-id="8509" width="32" height="32">
                                <path
                                    d="M465.46176 165.888a349.184 349.184 0 0 0-126.976 46.592l-9.728 5.632a235.52 235.52 0 0 0-20.992 15.36 303.104 303.104 0 0 0-86.528 108.032 344.064 344.064 0 0 0-21.504 60.928c-3.072 10.752-7.168 15.36-13.312 15.36A334.336 334.336 0 0 0 102.45376 451.584a388.096 388.096 0 0 0-51.2 41.984 212.992 212.992 0 0 0-51.2 143.36 208.384 208.384 0 0 0 68.608 157.696 227.84 227.84 0 0 0 96.256 55.808c40.448 10.752 28.672 10.24 345.6 10.24 266.752 0 293.888 0 311.808-3.072a334.848 334.848 0 0 0 57.856-14.848l9.728-4.608a264.704 264.704 0 0 0 47.616-29.184A222.208 222.208 0 0 0 1024.05376 636.416a261.632 261.632 0 0 0-13.312-73.216 27.136 27.136 0 0 1-3.072-8.192 198.656 198.656 0 0 0-19.968-37.376l-9.728-12.288a167.424 167.424 0 0 0-38.4-38.4 173.568 173.568 0 0 0-43.008-28.16l-9.216-4.096a494.08 494.08 0 0 0-51.2-17.408 358.4 358.4 0 0 0-37.888-3.072 216.576 216.576 0 0 0-76.8 7.68l-20.992 7.168a239.104 239.104 0 0 0-51.2 26.112 1382.4 1382.4 0 0 0-108.544 92.672q-95.744 88.576-192.512 176.128l-37.376 34.816-16.896 16.384h-34.304c-18.944 0-42.496 0-51.2-4.096a138.24 138.24 0 0 1-112.128-97.28 185.344 185.344 0 0 1 0-67.072 150.528 150.528 0 0 1 47.616-71.68 168.448 168.448 0 0 1 93.696-33.28 179.712 179.712 0 0 1 114.176 51.2l22.528 18.944 22.528 18.944a59.904 59.904 0 0 0 15.36 11.264c3.584 0 11.776-6.656 40.96-33.28a197.12 197.12 0 0 0 25.088-26.112 109.056 109.056 0 0 0-17.408-19.456l-23.552-19.456c-3.584-4.096-40.448-32.256-59.392-46.08a256 256 0 0 0-64-31.744 70.656 70.656 0 0 1-18.944-8.704 228.864 228.864 0 0 1 17.92-51.2 239.104 239.104 0 0 1 51.2-64 216.064 216.064 0 0 1 83.968-44.032L468.02176 256a173.056 173.056 0 0 1 44.032-4.096A171.52 171.52 0 0 1 563.25376 256a224.256 224.256 0 0 1 96.256 46.08A240.128 240.128 0 0 1 706.61376 358.4a150.016 150.016 0 0 0 10.24 15.36 64.512 64.512 0 0 0 14.848 0 370.688 370.688 0 0 1 45.056-4.096c35.84 0 36.864 0 29.184-15.36a123.904 123.904 0 0 1-6.656-14.848 75.264 75.264 0 0 0-7.168-14.848 81.92 81.92 0 0 1-5.632-9.728 364.544 364.544 0 0 0-40.448-51.2 320 320 0 0 0-90.112-64l-23.04-10.752a310.272 310.272 0 0 0-37.376-11.776 354.816 354.816 0 0 0-130.56-8.192z m350.208 338.944a139.776 139.776 0 0 1 80.896 45.568 115.2 115.2 0 0 1 32.768 84.48 82.944 82.944 0 0 1-4.608 40.448 124.928 124.928 0 0 1-24.064 45.568 147.456 147.456 0 0 1-76.288 47.104 406.528 406.528 0 0 1-41.984 4.608H434.74176a563.2 563.2 0 0 1 48.64-47.104L545.84576 665.6c22.016-20.48 107.008-97.792 119.296-108.032l12.8-11.776a245.76 245.76 0 0 1 43.008-29.184 177.152 177.152 0 0 1 26.112-10.24l17.408-5.12a199.68 199.68 0 0 1 51.2 0z m0 0"
                                    fill="#17abe3" p-id="8510"></path>
                            </svg>
                        </div>
                    </div>
                    <div @click="inputOpen()">
                        <div style="width: 32px;margin: 20px auto;">
                            <svg t="1705064866761" class="icon" viewBox="0 0 1024 1024" version="1.1"
                                xmlns="http://www.w3.org/2000/svg" p-id="12113" width="32" height="32">
                                <path
                                    d="M512 877.714286l384-219.428572L1024 731.428571l-512 292.571429-512-292.571429 128-73.142857z"
                                    fill="#4185F4" p-id="12114"></path>
                                <path
                                    d="M512 658.285714l384-219.428571L1024 512l-512 292.571429-512-292.571429 128-73.142857z"
                                    fill="#4185F4" p-id="12115"></path>
                                <path d="M1024 292.571429L512 585.142857 0 292.571429l512-292.571429z" fill="#A0C2F9"
                                    p-id="12116"></path>
                            </svg>
                        </div>
                    </div>
                </el-col>
                <el-col :span="20" class="pl-2">
                    <el-menu class="mt-2" mode="vertical" :default-openeds="openeds" default-active="1" unique-opened="true"
                        style="border-radius: 8px;">
                        <el-submenu v-for="( items, index ) in  menuItems " :key="items.id" :index="index">
                            <el-sub-menu :index="items.Menu.id">
                                <template #title>

                                    <el-icon v-if="items.Menu.icon">
                                        <template v-slot>
                                            <span v-html="items.Menu.icon"></span>
                                        </template>
                                    </el-icon>

                                    <span>{{ items.Menu.name }}</span>
                                    <el-tag class="ml-2" type="danger" effect="dark" size="small">
                                        {{ items.Count }}

                                    </el-tag>
                                </template>
                                <el-menu-item-group>
                                    <el-menu-item v-for=" ( item, index2 )  in  items.SubMenus " :key="item.id"
                                        :index="index2">

                                        <div class=" w-full" @click="OpenWin(item)">
                                            <el-icon v-if="item.icon">
                                                <template v-slot>
                                                    <span v-html="item.icon"></span>
                                                </template>
                                            </el-icon>

                                            {{ item.name }}
                                            <el-tag v-if="item.isOpen" size="small" effect="dark">OPEN</el-tag>
                                        </div>

                                        <el-icon v-if="item.isOpen" class="float-right" @click="CloseWin(item.name)">
                                            <Close class=" text-red-600" />
                                        </el-icon>
                                    </el-menu-item>
                                </el-menu-item-group>
                            </el-sub-menu>
                        </el-submenu>
                    </el-menu></el-col>
            </el-row>

        </div>

    </div>
</template>
<script>
import { app } from '@tauri-apps/api';
import { WebviewWindow, appWindow, LogicalSize, LogicalPosition } from "@tauri-apps/api/window";
import { invoke } from '@tauri-apps/api/tauri'
import { getClient, ResponseType } from '@tauri-apps/api/http';
//const invoke = window.__TAURI__.invoke
import FlipClock from "@/components/FlipClock.vue";
import qweather from "@/components/qweather.vue";
import ZTtime from "@/components/time.vue";
import axios from 'axios';
import { Body } from '@tauri-apps/api/http';
import http from '@/utils/http';
export default {

    data() {
        return {
            openeds: [1],
            menuItems: {},
            OS: "",
            isOpen: false,
            appList: [],
            sysList: [
                {
                    name: "我的电脑",
                    path: "explorer",
                    icon: "<svg t=\"1704791417312\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"17764\" width=\"32\" height=\"32\"><path d=\"M102.4 198.776471l84.329412-120.470589h451.764706l84.329411 120.470589H102.4z\" fill=\"#DEB538\" p-id=\"17765\"></path><path d=\"M120.470588 198.776471h783.058824c66.258824 0 120.470588 54.211765 120.470588 120.470588v481.882353c0 66.258824-54.211765 120.470588-120.470588 120.470588H120.470588c-66.258824 0-120.470588-54.211765-120.470588-120.470588v-481.882353c0-66.258824 54.211765-120.470588 120.470588-120.470588z\" fill=\"#FFD658\" p-id=\"17766\"></path></svg>"
                },
                {
                    name: "控制面板",
                    path: "control",
                    icon: "<svg t=\"1704791255093\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"43007\" width=\"32\" height=\"32\"><path d=\"M751.744 968.96H249.472c-114.048 0-206.464-92.416-206.464-206.464V260.224C43.008 146.176 135.424 53.76 249.472 53.76h502.272c114.048 0 206.464 92.416 206.464 206.464v502.272c0 114.048-92.416 206.464-206.464 206.464z\" fill=\"#CECED3\" p-id=\"43008\"></path><path d=\"M500.608 511.36m-371.456 0a371.456 371.456 0 1 0 742.912 0 371.456 371.456 0 1 0-742.912 0Z\" fill=\"#2A2A2B\" p-id=\"43009\"></path><path d=\"M725.76 519.296l-28.8-5.632v-0.64c0-1.792-0.256-3.456-0.256-5.248l28.928-7.936c2.176-0.64 1.92-3.968-0.384-4.096l-29.44-2.56c-0.256-1.92-0.64-3.84-0.896-5.76l28.16-11.008c2.048-0.768 1.408-4.096-0.768-4.096l-29.696 0.512c-0.384-1.92-1.024-3.712-1.408-5.504l27.008-13.952c1.92-1.024 1.024-4.224-1.152-3.968l-29.696 3.584c-0.512-1.792-1.28-3.456-1.92-5.248l25.6-16.896c1.792-1.152 0.512-4.352-1.536-3.84l-29.44 6.784c-0.768-1.664-1.664-3.328-2.432-4.992l23.808-19.584c1.664-1.408 0.128-4.352-1.92-3.584l-28.672 9.856c-0.896-1.536-1.92-3.072-2.816-4.608l21.76-22.016c1.536-1.536-0.384-4.352-2.304-3.456l-27.648 12.928c-1.024-1.408-2.176-2.816-3.2-4.224l19.456-24.32c1.408-1.664-0.768-4.224-2.688-3.2l-26.368 15.744c-1.152-1.28-2.304-2.688-3.584-3.968l16.768-26.24c1.152-1.92-1.28-4.224-2.944-2.816l-24.576 18.56c-1.28-1.152-2.56-2.432-3.84-3.584l13.952-27.904c1.024-1.92-1.664-3.968-3.328-2.56l-22.656 20.992c-1.408-1.024-2.816-2.176-4.224-3.2l11.008-29.312c0.768-2.048-2.048-3.84-3.584-2.176l-20.352 23.296c-1.536-0.896-2.944-1.92-4.48-2.688l7.936-30.208c0.512-2.176-2.432-3.584-3.712-1.792L581.632 334.08c-1.536-0.768-3.072-1.536-4.736-2.304l4.736-30.848c0.384-2.176-2.816-3.328-3.84-1.408l-14.976 27.008c-1.664-0.512-3.328-1.152-4.992-1.664l1.408-31.232c0.128-2.176-3.2-2.944-3.968-1.024l-12.032 28.416c-1.664-0.384-3.456-0.768-5.12-1.152l-1.792-31.232c-0.128-2.176-3.456-2.688-4.096-0.512l-9.088 29.44c-1.792-0.256-3.456-0.384-5.248-0.512l-5.12-30.848c-0.384-2.176-3.712-2.304-4.096-0.128l-5.888 30.208c-0.768 0-1.536-0.128-2.432-0.128-1.024 0-1.92 0.128-2.816 0.128l-8.32-30.208c-0.64-2.176-3.968-1.92-4.096 0.384l-2.688 30.592c-1.792 0.128-3.456 0.384-5.248 0.64l-11.392-29.056c-0.768-2.048-4.096-1.408-4.096 0.768l0.512 30.592c-1.792 0.384-3.456 0.768-5.12 1.152l-14.336-27.648c-1.024-1.92-4.224-1.024-3.968 1.152l3.712 30.336c-1.664 0.512-3.328 1.28-4.992 1.792L420.352 300.8c-1.152-1.792-4.352-0.512-3.84 1.536l6.784 29.696c-1.664 0.768-3.2 1.536-4.864 2.304l-19.712-24.064c-1.408-1.664-4.352-0.128-3.584 1.92l9.856 28.8c-1.536 0.896-3.072 1.92-4.608 2.816l-22.144-21.76c-1.536-1.536-4.352 0.384-3.456 2.304l12.8 27.52c-1.536 1.024-2.944 2.176-4.352 3.2l-24.192-19.328c-1.664-1.408-4.224 0.768-3.2 2.688l15.616 25.984c-1.408 1.152-2.688 2.432-4.096 3.712l-25.984-16.64c-1.92-1.152-4.224 1.28-2.816 2.944l18.176 24.192c-1.28 1.408-2.56 2.688-3.712 4.096l-27.392-13.696c-1.92-1.024-3.968 1.664-2.56 3.328l20.48 22.016c-1.152 1.536-2.304 2.944-3.328 4.48l-28.416-10.752c-2.048-0.768-3.84 2.048-2.176 3.584l22.528 19.584c-1.024 1.664-2.048 3.2-2.944 4.864l-29.184-7.552c-2.176-0.512-3.584 2.432-1.792 3.712l24.32 17.024c-0.768 1.792-1.792 3.456-2.56 5.248l-29.568-4.48c-2.176-0.384-3.328 2.816-1.408 3.84l25.728 14.336c-0.64 1.92-1.408 3.712-2.048 5.632l-29.568-1.408c-2.176-0.128-2.944 3.2-1.024 3.968l26.88 11.392c-0.512 1.92-1.024 3.84-1.408 5.888l-29.44 1.792c-2.176 0.128-2.688 3.456-0.512 4.096l27.776 8.576c-0.256 2.048-0.64 3.968-0.768 6.016l-28.928 4.736c-2.176 0.384-2.304 3.712-0.128 4.096l28.288 5.504c0 1.408-0.256 2.688-0.256 4.096 0 0.768 0.128 1.408 0.128 2.048l-28.16 7.808c-2.176 0.64-1.92 3.968 0.384 4.096l28.544 2.56c0.128 2.048 0.384 4.224 0.64 6.272l-27.008 10.624c-2.048 0.768-1.408 4.096 0.768 4.096l28.416-0.512c0.384 2.048 0.896 4.096 1.28 6.144l-25.6 13.312c-1.92 1.024-1.024 4.224 1.152 3.968l28.032-3.456c0.64 2.048 1.408 4.096 2.048 6.016l-24.064 15.872c-1.792 1.28-0.512 4.352 1.536 3.84l27.264-6.272c0.896 2.048 1.92 3.84 2.816 5.888L299.648 613.12c-1.664 1.408-0.128 4.352 1.92 3.584l26.496-9.088c1.024 1.92 2.304 3.712 3.328 5.504l-20.096 20.352c-1.536 1.536 0.384 4.352 2.304 3.456l25.344-11.776c1.28 1.792 2.56 3.456 3.968 5.248L325.12 652.672c-1.408 1.664 0.768 4.224 2.688 3.2l23.936-14.336c1.408 1.664 2.944 3.2 4.48 4.864l-15.232 23.936c-1.152 1.92 1.28 4.224 2.944 2.816l22.272-16.768c1.664 1.536 3.2 2.944 4.864 4.48L358.4 686.08c-1.024 1.92 1.664 3.968 3.328 2.56l20.352-18.944c1.792 1.28 3.584 2.688 5.376 3.968L377.6 700.16c-0.768 2.048 2.048 3.84 3.584 2.176l18.176-20.864c1.92 1.152 3.84 2.432 5.76 3.456l-7.04 27.008c-0.512 2.176 2.432 3.584 3.712 1.792l15.872-22.528c2.048 0.896 4.096 2.048 6.144 2.944l-4.096 27.392c-0.384 2.176 2.816 3.328 3.84 1.408l13.312-24.064c2.176 0.768 4.224 1.536 6.4 2.176l-1.28 27.776c-0.128 2.176 3.2 2.944 3.968 1.024l10.752-25.216c2.176 0.512 4.48 1.024 6.656 1.408l1.664 27.776c0.128 2.176 3.456 2.688 4.096 0.512l8.064-26.24c2.304 0.256 4.48 0.512 6.784 0.64l4.608 27.52c0.384 2.176 3.712 2.304 4.096 0.128l5.248-26.88c0.768 0 1.536 0.128 2.304 0.128 1.536 0 2.944-0.128 4.48-0.256l7.424 26.88c0.64 2.176 3.968 1.92 4.096-0.384l2.432-27.264c2.304-0.256 4.48-0.512 6.656-0.896l10.24 26.112c0.768 2.048 4.096 1.408 4.096-0.768l-0.512-27.392c2.176-0.384 4.352-1.152 6.528-1.664l12.928 24.96c1.024 1.92 4.224 1.024 3.968-1.152l-3.328-27.264c2.176-0.64 4.224-1.536 6.272-2.304l15.488 23.552c1.152 1.792 4.352 0.512 3.84-1.536l-6.144-27.008c2.048-0.896 3.968-1.92 6.016-2.944l17.92 21.888c1.408 1.664 4.352 0.128 3.584-1.92l-9.088-26.368c1.92-1.024 3.712-2.304 5.632-3.456l20.224 19.968c1.536 1.536 4.352-0.384 3.456-2.304l-11.904-25.472c1.792-1.28 3.456-2.56 5.12-3.84l22.4 17.92c1.664 1.408 4.224-0.768 3.2-2.688l-14.592-24.32c1.536-1.408 3.2-2.816 4.736-4.352l24.192 15.488c1.92 1.152 4.224-1.28 2.816-2.944L645.504 645.12c1.408-1.536 2.944-3.072 4.224-4.736l25.728 12.928c1.92 1.024 3.968-1.664 2.56-3.328l-19.456-20.864c1.28-1.664 2.56-3.328 3.712-4.992l27.136 10.24c2.048 0.768 3.84-2.048 2.176-3.456l-21.632-18.816c1.024-1.792 2.304-3.456 3.2-5.376l28.032 7.296c2.176 0.512 3.584-2.432 1.792-3.712l-23.552-16.512c0.896-1.92 1.792-3.712 2.56-5.632l28.928 4.352c2.176 0.384 3.328-2.816 1.408-3.84l-25.344-14.08c0.64-1.92 1.28-3.84 1.792-5.76l29.44 1.28c2.176 0.128 2.944-3.2 1.024-3.968l-26.752-11.392c0.384-1.92 0.768-3.968 1.152-5.888l29.568-1.792c2.176-0.128 2.688-3.456 0.512-4.096l-27.904-8.576c0.256-1.92 0.256-3.968 0.384-5.888l29.44-4.864c2.176-0.512 2.176-3.968 0.128-4.352z m-53.376-6.272c0 94.848-77.184 172.032-172.032 172.032-94.848 0-172.032-77.184-172.032-172.032s77.184-172.032 172.032-172.032c94.72 0 172.032 77.184 172.032 172.032z\" fill=\"#B4B4BA\" p-id=\"43010\"></path><path d=\"M844.928 523.392l-44.16-8.448v-1.024c0-2.816-0.256-5.376-0.256-7.936l44.16-12.288c3.328-1.024 2.816-6.144-0.512-6.4l-44.928-3.84c-0.256-3.072-1.024-5.888-1.28-8.96l43.136-16.896c3.072-1.024 2.048-6.144-1.28-6.144l-45.44 0.768c-0.512-2.816-1.536-5.632-2.048-8.448l41.088-21.504c3.072-1.536 1.536-6.4-1.792-5.888l-45.184 5.376c-1.024-2.56-2.048-5.376-3.072-7.936l39.04-25.856c2.816-1.792 0.768-6.656-2.56-5.888l-44.672 10.496-3.84-7.68 36.48-29.824c2.56-2.048 0-6.656-3.072-5.632l-43.904 15.36c-1.28-2.304-2.816-4.608-4.352-6.912l33.152-33.664c2.304-2.56-0.512-6.656-3.584-5.376L743.68 338.56c-1.536-2.048-3.072-4.352-4.864-6.4l29.568-37.248c2.304-2.56-1.024-6.4-4.096-4.864l-40.064 24.32c-1.792-2.048-3.584-4.096-5.632-5.888l25.856-40.32c1.792-2.816-1.792-6.4-4.608-4.352l-37.504 28.288-6.144-5.376 21.504-42.624c1.536-3.072-2.56-6.144-4.864-3.84l-34.688 32.128c-2.048-1.792-4.096-3.328-6.4-4.864l16.896-44.672c1.28-3.328-3.072-5.888-5.376-3.328l-30.848 35.456c-2.304-1.28-4.608-2.816-6.912-4.096l12.032-46.208c0.768-3.328-3.84-5.632-5.632-2.816L624.512 240.64c-2.304-1.28-4.608-2.56-7.168-3.584l7.168-47.232c0.512-3.328-4.352-5.12-5.888-2.048l-23.04 41.344c-2.56-1.024-5.12-2.048-7.68-2.816l2.304-47.744c0-3.328-4.864-4.352-6.144-1.28l-18.688 43.392c-2.56-0.768-5.12-1.28-7.68-1.792l-2.816-47.744c-0.256-3.328-5.376-4.096-6.4-0.768l-13.824 44.928c-2.56-0.256-5.376-0.512-7.936-0.768l-7.936-47.232c-0.512-3.328-5.632-3.584-6.144-0.256l-9.216 46.208h-3.584c-1.536 0-2.816 0-4.352 0.256l-12.8-46.208c-0.768-3.328-5.888-2.816-6.144 0.512l-4.352 46.72c-2.56 0.256-5.376 0.512-7.936 1.024l-17.408-44.672c-1.28-3.072-6.4-2.048-6.144 1.28l0.768 46.72c-2.816 0.512-5.376 1.28-7.936 1.792l-22.016-42.112c-1.536-3.072-6.656-1.536-6.144 1.792l5.632 46.208c-2.56 0.768-5.12 1.792-7.68 2.816l-26.368-39.808c-1.792-2.816-6.4-0.768-5.632 2.304l10.24 45.44c-2.304 1.024-4.864 2.56-7.424 3.584l-30.08-36.736c-2.048-2.56-6.656 0-5.376 3.072l15.104 43.904c-2.56 1.536-4.864 3.072-7.168 4.352l-33.664-33.152c-2.304-2.56-6.656 0.512-5.12 3.584l19.456 42.112c-2.304 1.536-4.352 3.328-6.656 4.864l-36.736-29.312c-2.816-2.304-6.656 1.024-4.864 4.096l23.808 39.552c-2.048 1.792-4.096 3.84-6.144 5.632L257.408 267.52c-3.072-1.792-6.4 1.792-4.352 4.608l27.648 36.736c-1.792 2.048-3.84 4.352-5.632 6.4l-41.856-20.992c-3.072-1.536-6.144 2.56-3.84 4.864l31.36 33.664-5.376 6.912-43.392-16.384c-3.072-1.28-5.888 3.072-3.328 5.376l34.432 29.824-4.608 7.68-44.672-11.776c-3.328-0.768-5.376 3.84-2.56 5.632l36.992 26.112c-1.28 2.816-2.816 5.376-3.84 8.192l-45.184-6.912c-3.328-0.512-5.12 4.352-2.304 5.888l39.296 22.016-3.072 8.448-45.184-2.048c-3.328-0.256-4.608 4.864-1.536 6.144l41.088 17.664c-0.768 2.816-1.536 5.888-2.304 8.96l-44.928 2.56c-3.328 0.256-4.096 5.376-0.768 6.4l42.368 13.056c-0.256 3.072-0.768 6.144-1.024 9.216l-44.416 7.168c-3.328 0.768-3.328 5.888 0 6.4l43.136 8.448c0 2.304-0.256 4.096-0.256 6.4 0 1.024 0.256 2.048 0.256 3.072l-43.136 12.032c-3.328 0.768-2.816 5.888 0.512 6.144l43.648 3.84c0.256 3.328 0.512 6.4 0.768 9.728l-41.088 16.128c-3.328 1.28-2.304 6.4 1.024 6.144l43.392-0.512c0.768 3.072 1.536 6.144 2.048 9.472L167.68 600.448c-3.072 1.536-1.536 6.4 1.792 6.144l42.88-5.376c0.768 3.328 2.048 6.4 3.072 9.472l-36.736 24.32c-2.816 1.792-0.768 6.4 2.56 5.632l41.6-9.472c1.28 3.072 3.072 5.888 4.352 8.96l-33.664 27.776c-2.816 2.048-0.256 6.656 2.816 5.376l40.576-13.824c1.536 2.816 3.328 5.632 5.12 8.448l-30.592 31.104c-2.304 2.304 0.512 6.656 3.584 5.12l38.784-17.92c1.792 2.56 3.84 5.376 5.888 7.936l-27.136 33.92c-2.048 2.816 1.28 6.656 4.096 4.864l36.48-22.016c2.304 2.56 4.608 5.12 6.912 7.424l-23.552 36.48c-1.792 2.816 2.048 6.4 4.608 4.352l33.92-25.6 7.68 6.912-19.456 38.528c-1.536 3.072 2.56 6.144 5.12 3.84l30.848-28.8c2.816 2.048 5.376 4.096 8.192 6.144L312.576 800c-1.28 3.072 3.328 5.888 5.376 3.328l27.776-31.872c2.816 1.792 5.888 3.584 8.704 5.376l-10.752 41.344c-0.768 3.328 3.84 5.376 5.888 2.56l24.064-34.432c3.328 1.536 6.4 3.328 9.472 4.608l-6.4 41.856c-0.512 3.328 4.352 5.12 6.144 2.304l20.224-36.736c3.328 1.024 6.656 2.304 9.984 3.328l-2.048 42.368c0 3.328 4.864 4.608 6.144 1.536l16.64-38.528c3.328 0.768 6.656 1.536 10.24 2.048l2.304 42.624c0.256 3.328 5.376 3.84 6.4 0.768l12.288-40.064c3.584 0.512 6.912 0.768 10.496 1.024l6.912 42.112c0.512 3.328 5.632 3.328 6.4 0l7.936-41.088c1.28 0 2.304 0.256 3.584 0.256 2.304 0 4.608-0.256 6.912-0.512l11.264 41.344c1.024 3.072 5.888 2.816 6.4-0.512l3.584-41.856c3.584-0.256 6.912-0.768 10.24-1.28l15.616 39.808c1.28 3.072 6.4 2.304 6.4-1.024l-0.768-42.112c3.328-0.512 6.656-1.536 9.984-2.304l19.968 38.016c1.536 3.072 6.4 1.536 5.888-1.792l-5.12-41.856c3.328-1.024 6.4-2.304 9.728-3.328l23.808 35.968c1.792 2.816 6.656 0.768 5.888-2.56l-9.472-41.344c3.072-1.28 5.888-2.816 8.96-4.352l27.52 33.408c2.048 2.56 6.656 0.256 5.632-3.072l-14.08-40.32c3.072-1.536 5.888-3.328 8.704-5.12l30.848 30.592c2.56 2.304 6.656-0.512 5.376-3.584l-18.176-39.04c2.56-1.792 5.12-3.84 7.936-5.888l34.176 27.264c2.56 2.048 6.4-1.28 4.608-4.096l-22.272-36.992c2.56-2.304 4.864-4.352 7.424-6.656l36.992 23.808c2.816 1.792 6.4-2.048 4.352-4.608l-26.368-34.688c2.304-2.56 4.608-4.864 6.656-7.168l39.296 19.712c3.072 1.536 6.144-2.56 3.84-5.12l-29.568-31.872c1.792-2.56 3.84-5.12 5.632-7.68l41.344 15.616c3.328 1.024 5.888-3.328 3.328-5.376l-32.896-28.8c1.536-2.816 3.328-5.376 4.864-8.192l42.88 11.264c3.328 0.768 5.632-3.84 2.816-5.888l-35.968-25.344c1.28-2.816 2.56-5.632 3.84-8.704l44.16 6.912c3.328 0.512 4.864-4.352 2.048-6.144l-38.528-21.504c0.768-2.816 1.792-5.888 2.56-8.96l44.928 2.048c3.584 0.256 4.608-4.608 1.536-6.144L793.856 577.28c0.768-2.816 1.28-5.888 1.792-8.96l45.184-2.816c3.328 0 4.096-5.12 0.768-6.144l-42.624-13.056c0.256-3.072 0.512-6.144 0.512-9.216l45.184-7.424c3.328-0.384 3.328-5.504 0.256-6.272zM361.6 691.968C351.744 709.12 327.68 713.216 313.6 698.88c-47.232-47.488-76.672-112.896-76.672-184.96 0-72.32 29.312-137.344 76.416-184.96 14.336-14.336 38.272-10.24 48.256 7.168l87.296 152.192c9.472 16.64 9.472 36.736 0 53.12l-87.296 150.528z m394.112-116.736C727.936 690.944 623.872 776.96 500.096 776.96c-32.64 0-64.128-6.144-92.928-17.152-17.664-6.656-24.32-27.776-15.104-44.16l88.064-151.68c9.472-16.384 27.136-26.368 45.952-26.368l199.424 0.256c19.456 0.384 34.816 18.56 30.208 37.376z m-284.032-60.032c0-7.168 5.888-12.8 12.8-12.8 7.168 0 12.8 5.632 12.8 12.8s-5.632 12.8-12.8 12.8c-6.912 0-12.8-5.632-12.8-12.8z m255.744-15.232l-197.504-0.512c-18.944 0-36.48-10.24-45.952-26.88l-92.16-160.64c-9.216-16.128-2.56-37.248 15.104-43.904 28.8-11.264 60.288-17.152 93.184-17.152 127.744 0 234.496 91.648 257.92 212.736 3.584 18.944-11.52 36.352-30.592 36.352z\" fill=\"#CECED3\" p-id=\"43011\"></path></svg>"
                },
                {
                    name: "geek",
                    path: "C:/Users/40688/Desktop/geek.exe",
                    icon: "<svg t=\"1704816034385\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"5689\" width=\"32\" height=\"32\"><path d=\"M866.9 661.4H660.5l0.2-78.2s-105.4 130-105.4 182.7c0 52.7 105.4 182.7 105.4 182.7l-0.2-78.1h105.1c25.4 0.2 50.1-12.9 63.6-36.3l130.2-225.8c-19 33-54.6 53.3-92.5 53zM719.3 347.1c45.6-26.4 105.4-182.6 105.4-182.6l-67.6 39.2s-26.4-46.2-36.9-64.5c-14.9-25.7-42.4-41.9-72.1-41.8-29.8 0-57.2 16.3-71.8 42.2-0.1 0.1-24.3 41.8-48.6 84.2l49.1 85.1-68.3 38.4c0-0.1 165.2 26.1 210.8-0.2z\" fill=\"#3ABA72\" p-id=\"5690\"></path><path d=\"M772.7 639.3h97.1c29.9 0.3 57.5-15.7 72.5-41.4 14.8-25.7 14.7-57.7-0.4-83.4 0-0.1-52.2-90.5-93.7-162.4L667.3 456.6l105.4 182.7zM313 555.4l67.7 39.3S320.9 438.4 275.3 412c-45.7-26.3-210.8 0-210.8 0l67.8 39-52.6 91.2c-12.9 21.9-13.9 49.8-0.4 73.3l130.2 225.8c-19-33.1-18.9-74 0.3-106.9l103.2-179z\" fill=\"#3ABA72\" p-id=\"5691\"></path><path d=\"M226.7 747.3c-15.1 25.5-15.2 57.5-0.3 83.2 14.8 25.8 42.6 41.7 72.3 41.5h187.5V663h-211c-24.3 42.3-48.5 84.2-48.5 84.3zM557.1 128.2c19.2-32.9 52.8-52.8 90.8-52.8H387.5c-27.2 0-50 15.3-63.3 36.9-23 37.5-109.8 190.2-109.8 190.2L396 407.4S532.3 171 557.1 128.2z\" fill=\"#3ABA72\" p-id=\"5692\"></path></svg>"
                },
                {
                    name: "ChatGPI",
                    path: "D:/Program Files/chataa/chataa.exe",
                    icon: "<svg t=\"1705499420432\" class=\"icon\" viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"3566\" width=\"32\" height=\"32\"><path d=\"M565.265178 954.519092c-22.289934 0-48.400999-8.151747-67.952455-14.838727a103.425292 103.425292 0 0 1-26.875292-11.272338c-12.737105-7.769634-15.411897-8.342804-19.806198-24.773669 21.971506-5.158528 81.581157-41.905075 103.871091-55.342721 148.896757-89.159735 119.028246-10.444426 119.028246-364.981743 15.029784 3.566389 82.791182 32.415932 82.791182 57.316972 0 133.102747 20.570425 273.847757-52.604243 354.91943-22.799418 25.47421-91.834527 58.972796-138.388646 58.972796z m-433.061569-299.321966c258.626916 136.860193 184.369594 157.048504 357.721593 52.094759 44.579867-27.193719 90.433445-49.292596 132.593263-77.568969v101.896839c-95.528287 22.226248-272.319304 227.038896-419.050754 100.686815l-25.856323-25.155782c-37.319718-43.943012-45.344094-72.410442-45.344094-151.889977z m375.744596-19.105658c-19.933569-13.310275-79.479535-51.330533-101.896839-57.316972v-133.739602a1158.312326 1158.312326 0 0 0 101.896839-57.316973c43.943012 10.189684 70.690933 47.063603 114.633945 57.316973v127.371049c-17.831947 12.10025-95.846715 58.718054-114.633945 63.749211z m-426.693016-178.31947c0-63.685525-4.26693-90.306074 38.84817-145.776166 23.945757-30.88748 47.509402-39.612396 82.090641-57.953828v261.110652c44.134069 23.372588 83.873836 49.037854 129.345301 74.448379l131.765351 78.396881c-59.545966 15.921381-63.685525 61.32916-109.602788 33.753328-104.699003-62.730242-272.38299-129.345301-272.38299-243.91556z m866.123138 127.37105c0 79.543221-47.573087 161.188063-121.002497 178.31947v-165.582365c0-82.791182 9.743885-84.574377-48.910483-116.608196L565.265178 362.371082c15.79401-23.62733 22.608361-19.105657 48.146256-34.835982 41.714019-25.47421 39.039227-16.112438 117.053995 28.785857 94.190891 54.196382 216.849212 100.559444 216.849212 228.885777z m-541.326961-197.425127v-95.528287c43.751956-23.181531 90.688187-50.94842 133.357489-76.804743 82.154327-49.547338 95.528287-63.303412 185.006449-63.303412 48.464684 0 102.533695 36.746548 125.651541 65.405034 42.223503 52.22213 39.930824 92.662439 39.930824 151.125751-31.078536-16.494551-192.393971-121.002497-222.899337-121.002498s-229.650003 123.422547-261.110652 140.108155z m-50.94842 159.213812c-16.36718-10.95391-63.112355-39.99451-82.791183-44.579867 0-168.320842-33.880699-314.606493 67.952455-390.519639 56.043262-41.714019 113.169178-53.814269 181.376375-30.696423 25.47421 8.661231 35.536523 20.888852 56.36169 26.429493-11.781822 16.048752-80.68956 50.311565-102.278953 63.303412-154.564769 93.235608-120.620384 7.451206-120.620384 376.063024z m-292.953415 121.002498c0 169.148754 115.143429 280.853165 274.293556 273.847756 59.800708-2.674792 26.811606-7.705949 69.417222 25.47421 97.820966 76.741057 228.822091 73.747838 319.637649 1.018969a251.939936 251.939936 0 0 0 52.604244-55.661149c58.20857-85.274918-10.95391-45.598836 81.96327-83.619094 130.236898-53.241099 199.399378-217.358696 128.64476-355.428914-27.448461-53.559526-40.249252-28.849543-28.276373-104.699003 18.723544-118.582447-63.176041-230.032116-157.621674-269.771884-98.90362-41.586648-129.090559 12.737105-178.892639-37.574459A161.888604 161.888604 0 0 0 580.103905 28.913674C474.003821-27.766443 331.284559 1.528898 258.428319 93.681853c-81.326415 102.979494 9.489143 54.705866-92.407697 98.648878C15.149614 257.353652-33.251385 439.175825 41.579107 561.06992c56.807488 92.598753 20.570425 4.967471 20.570424 106.800625z\" fill=\"#10A37F\" p-id=\"3567\"></path></svg>"
                }
            ],
            p: null,
            token: "",
            chatlist: [],
        };
    },

    components: { FlipClock, qweather, ZTtime },

    computed: {},

    mounted() {
        const ww = WebviewWindow.getByLabel("main");
        ww.setPosition(new LogicalPosition(window.screen.width - 600, 180));
        invoke('check_os').then((message) => this.OS = message);
        invoke('get_file_infos', { path: 'F:\\' }).then((message) => console.log(message))
        this.getList();
        //invoke('get_sys_info').then((message) => console.log(message));
        this.fetchMenus();
        console.log(this.menuItems);
        //this.inputOpen();

        this.$nextTick(() => {


        });




    },

    created() { },
    watch: {
        // 检查 watcher 是否会导致循环更新
        watchedProperty(newValue) {
            // 逻辑代码
            console.log(newValue)
        }
    },
    methods: {
        // async chat() {

        //     const url = 'http://119.45.240.39:11000/api/user/login';

        //     const body = Body.json({
        //         email: "zhangteng0208@163.com",
        //         password: "123456"
        //     });

        //     http(url, {
        //         method: 'post',
        //         body,
        //     }).then(response => {
        //         console.log('Response:', response.data);
        //         this.token = response.data.data.token; // 假设token在response.data.token中

        //         http('http://119.45.240.39:11000/api/chat/ack/all', {
        //             method: 'get',
        //             headers: {
        //                 'x-token': this.token
        //             },
        //         }).then(response => {
        //             console.log('Response:', response.data);
        //             this.chatlist = response.data;


        //         })
        //             .catch(error => {
        //                 console.error('Error:', error.response.data);
        //             });
        //     })
        //         .catch(error => {
        //             console.error('Error:', error.response.data);
        //         });



        // },
        async oc() {
            this.isOpen = !this.isOpen;

            if (this.isOpen) {
                const Physical = await appWindow.outerPosition();
                this.p = Physical;
                await appWindow.setSize(new LogicalSize(450, 900));

                console.log(window.screen.height - Physical.y < 1000)
                if (window.screen.height - Physical.y < 1000) {
                    await appWindow.setPosition(new LogicalPosition(Physical.x, window.screen.height - 1000));
                }
            }
            else {
                console.log(this.p.x, this.p.y)
                await appWindow.setSize(new LogicalSize(400, 200));
                await appWindow.setPosition(new LogicalPosition(this.p.x, this.p.y));
            }
        },

        appOpen(l) {
            // Invoke the command "D:/tabby/Tabby.exe"
            invoke('my_custom_command', { invokeMessage: l.path }).then((message) => console.log(message))
        },
        async inputOpen() {
            console.log("inputOpen")

            const windowConfig = {
                "label": "input",
                "fullscreen": false,
                "maximized": false,
                "resizable": true,
                "title": "zt-win-terminal",
                "width": 500,
                "height": 300,

                "decorations": false,
                "alwaysOnTop": true,
                "transparent": true,
                "theme": "Dark",
                //"center": true,
                "url": "#/t"
            }
            const ww = WebviewWindow.getByLabel("input");

            if (ww != null) {

                await ww.setFocus();
            }
            else {
                const webview = new WebviewWindow("input", windowConfig);

                webview.once("tauri://created", function () {
                    // webview window successfully created
                    // 窗口创建成功 打印1
                    console.log(window.screen.height);
                    webview.setPosition(new LogicalPosition(10, window.screen.height - 180));
                });
                webview.once("tauri://error", function (e) {
                    // an error happened creating the webview window
                    // 窗口创建失败 打印2
                    console.log(e);
                });
                let that = this;
                webview.once("tauri://close-requested", function (e) {

                });
            }
        },
        cosOpen() {
            console.log("cosOpen")
            const windowConfig = {
                "label": "txcos",
                "fullscreen": false,
                "maximized": false,
                "resizable": true,
                "title": "zt-win-terminal",
                "width": 400,
                "height": 650,

                "decorations": false,
                "alwaysOnTop": true,
                "transparent": true,
                "theme": "Dark",
                //"center": true,
                "url": "#/cos"
            }
            console.log(windowConfig.x)
            const webview = new WebviewWindow("txcos", windowConfig);

            webview.once("tauri://created", function () {
                // webview window successfully created
                // 窗口创建成功 打印1
                console.log(1);
                webview.setPosition(new LogicalPosition(50, 50));
            });
            webview.once("tauri://error", function (e) {
                // an error happened creating the webview window
                // 窗口创建失败 打印2
                console.log(e);
            });
            let that = this;
            webview.once("tauri://close-requested", function (e) {

            });

        },
        weatherOpen() {
            console.log("weatherOpen")
            const windowConfig = {
                "label": "ZTweather",
                "fullscreen": false,
                "maximized": false,
                "resizable": true,
                "title": "zt-win-terminal",
                "width": 400,
                "height": 1000,

                "decorations": false,
                "alwaysOnTop": true,
                "transparent": true,
                "theme": "Dark",
                //"center": true,
                "url": "#/w"
            }

            const webview = new WebviewWindow("ZTweather", windowConfig);

            webview.once("tauri://created", function () {
                // webview window successfully created
                // 窗口创建成功 打印1
                console.log(1);
                webview.setPosition(new LogicalPosition(50, 50));
            });
            webview.once("tauri://error", function (e) {
                // an error happened creating the webview window
                // 窗口创建失败 打印2
                console.log(e);
            });
            let that = this;
            webview.once("tauri://close-requested", function (e) {

            });

        },
        mapOpen() {
            console.log("weatherOpen")
            const windowConfig = {
                "label": "ZTmap",
                "fullscreen": false,
                "maximized": false,
                "resizable": true,
                "title": "zt-win-terminal",
                "width": 500,
                "height": 500,

                "decorations": false,
                "alwaysOnTop": true,
                "transparent": true,
                "theme": "Dark",
                //"center": true,
                "url": "#/map"
            }

            const webview = new WebviewWindow("ZTmap", windowConfig);

            webview.once("tauri://created", function () {
                // webview window successfully created
                // 窗口创建成功 打印1
                console.log(1);
                webview.setPosition(new LogicalPosition(50, 50));
            });
            webview.once("tauri://error", function (e) {
                // an error happened creating the webview window
                // 窗口创建失败 打印2
                console.log(e);
            });
            let that = this;
            webview.once("tauri://close-requested", function (e) {

            });

        },
        dateOpen() {
            console.log("weatherOpen")
            const windowConfig = {
                "label": "ZTweather",
                "fullscreen": true,
                "maximized": false,
                "resizable": false,
                "title": "zt-win-terminal",



                "decorations": false,
                //"alwaysOnTop": true,
                "transparent": true,
                "theme": "Dark",
                "center": true,
                "url": "#/date"
            }

            const webview = new WebviewWindow("ZTweather", windowConfig);

            webview.once("tauri://created", function () {
                // webview window successfully created
                // 窗口创建成功 打印1
                console.log(1);
                webview.setPosition(new LogicalPosition(0, 0));
                webview.setSize(new LogicalSize(window.screen.width, window.screen.height));
            });
            webview.once("tauri://error", function (e) {
                // an error happened creating the webview window
                // 窗口创建失败 打印2
                console.log(e);
            });
            let that = this;
            webview.once("tauri://close-requested", function (e) {

            });

        },
        OpenWin(m) {
            const windowConfig = {
                url: m.url,
                title: m.name,
                // 可自行添加属性配置     窗口配置
                //center: true,
                //decorations:false
            }
            if (m.x == 0 && m.y == 0) {
                windowConfig.center = true;
            }
            else {
                windowConfig.x = m.x;
                windowConfig.y = m.y;
            }
            if (m.w == 0 && m.h == 0) {
                windowConfig.width = 800;
                windowConfig.height = 600;
                windowConfig.maximized = true;
            }
            else {
                windowConfig.width = m.w;
                windowConfig.height = m.h;
            }
            console.log("windowConfig", windowConfig)
            const webview = new WebviewWindow(m.name, windowConfig);
            var i = this.foundElementPosition(m.name);
            this.menuItems[i.outerIndex].SubMenus[i.innerIndex].isOpen = 1;
            webview.once("tauri://created", function () {
                // webview window successfully created
                // 窗口创建成功 打印1
                console.log(1);
            });
            webview.once("tauri://error", function (e) {
                // an error happened creating the webview window
                // 窗口创建失败 打印2
                console.log(2);
            });
            let that = this;
            webview.once("tauri://close-requested", function (e) {
                // an error happened creating the webview window
                // 窗口创建失败 打印2

                that.menuItems[i.outerIndex].SubMenus[i.innerIndex].isOpen = 0;




            });


            // const testWindow = WebviewWindow.getByLabel("test");
            // testWindow.show();
        },
        CloseWin(name) {

            const win = WebviewWindow.getByLabel(name);
            win.close();
            var i = this.foundElementPosition(name);
            this.menuItems[i.outerIndex].SubMenus[i.innerIndex].isOpen = 0;
        },

        async fetchMenus() {

            // await appWindow.setIgnoreCursorEvents(true);
            const client = await getClient();
            const response = await client.get('https://zhangteng.cloud/5001/api/mainControllers/GetMenu', {
                timeout: 30,
                // the expected response type
                responseType: ResponseType.JSON
            });

            this.menuItems = response.data;

            // try {

            //   const response = await axios.get('/api/mainControllers/GetMenu');
            //   this.menuItems = response.data;
            console.log(this.menuItems);
            // } catch (error) {
            //   console.error('Error fetching menus:', error);
            //   ElNotification({
            //     title: 'Error fetching menus',
            //     message: error,
            //     type: 'success',
            //   })
            // }
        },
        foundElementPosition(name) {
            for (let outerIndex = 0; outerIndex < this.menuItems.length; outerIndex++) {
                const children = this.menuItems[outerIndex].SubMenus;
                for (let innerIndex = 0; innerIndex < children.length; innerIndex++) {
                    if (children[innerIndex].name === name) {
                        return { outerIndex, innerIndex };
                    }
                }
            }
            return null;
        },

        async getList() {
            const client = await getClient();
            const response = await client.get('https://zt-1304966785.cos.ap-nanjing.myqcloud.com/app.json', {
                timeout: 30,
                // the expected response type
                responseType: ResponseType.JSON
            });
            console.log(response.data)
            this.appList = response.data.shortcuts;
        },



    }
}
</script>
<style scoped>
html,
body {
    background-color: rgb(0 0 0/0%) !important;
}


@keyframes animate {
    to {
        transform: rotate(1turn);
    }
}

@keyframes huerotate {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

.containers {
    position: relative;
    width: 180px;
    height: 180px;

}

.circle-image2 {
    position: absolute;
    top: 5%;
    /* 调整位置使图片居中 */
    left: 5%;
    width: 90%;
    /* 减小图片大小 */
    height: 90%;
    background-image: url('https://zt-1304966785.cos.ap-nanjing.myqcloud.com/65194888-78cb-4da0-a4d3-7465876675dc.jpg');
    background-size: 100% 100%;
    border-radius: 50%;
}

.circle-image2::before {
    content: '';
    position: absolute;
    top: 5%;
    /* 调整位置使图片居中 */
    left: 5%;
    width: 90%;
    /* 减小图片大小 */
    height: 90%;

    background-size: 100% 100%;
    border-radius: 50%;
    z-index: 2;
    border: 0px #240229 solid;

    /* 确保图片在最上层 */
}

.circle-image2 span {
    position: absolute;
    top: 0%;
    /* 调整位置使图片居中 */
    left: 0%;
    width: 100%;
    /* 减小图片大小 */
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(#FF0000, #FFA500, #FFFF00, #00FF00, #00FFFF, #0000FF, #800080);
    filter: blur(15px);
    animation: r 5s linear infinite;
    z-index: -1;
}

.circle-image {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    /* 减小图片大小 */
    height: 80%;

    border-radius: 50%;

    border: 4px #240229 solid;
    box-shadow: -5px -5px 5px rgba(255, 255, 255, 0.1),
        10px 10px 10px rgba(0, 0, 0, 0.4),
        inset -5px -5px 5px rgba(32, 9, 9, 0.2),
        inset 10px 10px 10px rgba(0, 0, 0, 0.4)
        /* 确保图片在最上层 */
}

.circle-image::before {
    content: '';
    position: absolute;
    top: 5%;
    /* 调整位置使图片居中 */
    left: 5%;
    width: 90%;
    /* 减小图片大小 */
    height: 90%;

    background-size: 100% 100%;
    border-radius: 50%;
    z-index: 2;
    border: 0px #240229 solid;

    /* 确保图片在最上层 */
}

.circle-image span {
    position: absolute;
    top: 0%;
    /* 调整位置使图片居中 */
    left: 0%;
    width: 100%;
    /* 减小图片大小 */
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(#FF0000, #FFA500, #FFFF00, #00FF00, #00FFFF, #0000FF, #800080);
    filter: blur(15px);
    animation: r 5s linear infinite;
    z-index: -1;
}

@keyframes r {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes mymove1 {
    from {
        -webkit-box-shadow: 0 0 9px rgb(70, 191, 228);
    }

    50% {
        -webkit-box-shadow: 0 0 18px #88f1ff;
    }

    to {
        -webkit-box-shadow: 0 0 9px rgb(49, 209, 62);
    }
}

.ellipse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0.8;
    /* 调整颜色 */
    z-index: 1;
    /* 确保椭圆在图片后面 */
}

.rotate1 {
    background: rgba(255, 0, 0, 0.8);
    border-radius: 38% 62% 63% 37% / 43% 44% 56% 59%;
    /* 红色，半透明 */
    animation: rotate 6s linear infinite;
}


.rotate2 {
    background: rgba(255, 165, 0, 0.8);
    border-radius: 62% 38% 63% 37% / 44% 43% 56% 59%;
    animation: rotate2 6s linear infinite;

}


.rotate3 {
    background: rgba(255, 255, 0, 0.8);
    border-radius: 62% 38% 37% 63% / 44% 43% 59% 56%;
    animation: rotate 6s linear infinite;

}


.rotate4 {
    background: rgba(0, 255, 0, 0.8);
    border-radius: 39% 38% 47% 48% / 47% 47% 31% 51%;
    animation: rotate 6s linear infinite;

}


.rotate5 {
    background: rgba(0, 127, 255, 0.8);
    border-radius: 44% 44% 41% 53% / 56% 43% 39% 56%;
    animation: rotate 6s linear infinite;

}

.rotate6 {
    background: rgba(0, 0, 255, 0.8);
    border-radius: 55% 38% 57% 63% / 44% 43% 59% 46%;
    animation: rotate 6s linear infinite;

}

.rotate7 {
    background: rgba(139, 0, 255, 0.8);
    border-radius: 42% 58% 57% 43% / 67% 43% 59% 56%;

    animation: rotate 6s linear infinite;
}



@keyframes rotate {
    0% {
        transform: rotate(0deg) scaleX(1);
    }

    20% {
        transform: rotate(90deg) scaleX(1.1);
    }

    40% {
        transform: rotate(180deg) scaleX(1.15);
    }

    80% {
        transform: rotate(270deg) scaleX(1.1);
    }

    100% {
        transform: rotate(360deg) scaleX(1);
    }
}

@keyframes rotate2 {
    0% {
        transform: rotate(45deg) scaleX(1);
    }

    20% {
        transform: rotate(135deg) scaleX(1.1);
    }

    40% {
        transform: rotate(180deg) scaleX(1.2);
    }

    80% {
        transform: rotate(225deg) scaleX(1.1);
    }

    100% {
        transform: rotate(270deg) scaleX(1);
    }
}

@keyframes rotate3 {
    0% {
        transform: rotate(0deg) scaleX(1);
    }

    20% {
        transform: rotate(100deg) scaleX(1.1);
    }

    40% {
        transform: rotate(200deg) scaleX(1.15);
    }

    80% {
        transform: rotate(300deg) scaleX(1.1);
    }

    100% {
        transform: rotate(360deg) scaleX(1);
    }
}

.conic-demo::after {
    animation: opacityChange 5s infinite linear;
}



@keyframes opacityChange {
    50% {
        opacity: .5;
    }

    100% {
        opacity: 1;
    }
}
</style>
  